Integrand size = 21, antiderivative size = 176 \[ \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {3 \left (2 a^2+b^2\right ) \text {arcsinh}(\tan (c+d x)) \sec (c+d x)}{2 b^4 d \sqrt {\sec ^2(c+d x)}}+\frac {3 a \sqrt {a^2+b^2} \text {arctanh}\left (\frac {b-a \tan (c+d x)}{\sqrt {a^2+b^2} \sqrt {\sec ^2(c+d x)}}\right ) \sec (c+d x)}{b^4 d \sqrt {\sec ^2(c+d x)}}-\frac {3 \sec (c+d x) (2 a-b \tan (c+d x))}{2 b^3 d}-\frac {\sec ^3(c+d x)}{b d (a+b \tan (c+d x))} \]
3/2*(2*a^2+b^2)*arcsinh(tan(d*x+c))*sec(d*x+c)/b^4/d/(sec(d*x+c)^2)^(1/2)+ 3*a*arctanh((b-a*tan(d*x+c))/(a^2+b^2)^(1/2)/(sec(d*x+c)^2)^(1/2))*sec(d*x +c)*(a^2+b^2)^(1/2)/b^4/d/(sec(d*x+c)^2)^(1/2)-3/2*sec(d*x+c)*(2*a-b*tan(d *x+c))/b^3/d-sec(d*x+c)^3/b/d/(a+b*tan(d*x+c))
Result contains complex when optimal does not.
Time = 6.58 (sec) , antiderivative size = 709, normalized size of antiderivative = 4.03 \[ \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {(a-i b) (a+i b) \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))}{b^3 d (a+b \tan (c+d x))^2}-\frac {2 a \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2}{b^3 d (a+b \tan (c+d x))^2}-\frac {6 a \sqrt {a^2+b^2} \text {arctanh}\left (\frac {\sqrt {a^2+b^2} \left (-b \cos \left (\frac {1}{2} (c+d x)\right )+a \sin \left (\frac {1}{2} (c+d x)\right )\right )}{a^2 \cos \left (\frac {1}{2} (c+d x)\right )+b^2 \cos \left (\frac {1}{2} (c+d x)\right )}\right ) \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2}{b^4 d (a+b \tan (c+d x))^2}-\frac {3 \left (2 a^2+b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2}{2 b^4 d (a+b \tan (c+d x))^2}+\frac {3 \left (2 a^2+b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) \sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2}{2 b^4 d (a+b \tan (c+d x))^2}+\frac {\sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2}{4 b^2 d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2 (a+b \tan (c+d x))^2}-\frac {2 a \sec ^2(c+d x) \sin \left (\frac {1}{2} (c+d x)\right ) (a \cos (c+d x)+b \sin (c+d x))^2}{b^3 d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) (a+b \tan (c+d x))^2}-\frac {\sec ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2}{4 b^2 d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2 (a+b \tan (c+d x))^2}+\frac {2 a \sec ^2(c+d x) \sin \left (\frac {1}{2} (c+d x)\right ) (a \cos (c+d x)+b \sin (c+d x))^2}{b^3 d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) (a+b \tan (c+d x))^2} \]
-(((a - I*b)*(a + I*b)*Sec[c + d*x]^2*(a*Cos[c + d*x] + b*Sin[c + d*x]))/( b^3*d*(a + b*Tan[c + d*x])^2)) - (2*a*Sec[c + d*x]^2*(a*Cos[c + d*x] + b*S in[c + d*x])^2)/(b^3*d*(a + b*Tan[c + d*x])^2) - (6*a*Sqrt[a^2 + b^2]*ArcT anh[(Sqrt[a^2 + b^2]*(-(b*Cos[(c + d*x)/2]) + a*Sin[(c + d*x)/2]))/(a^2*Co s[(c + d*x)/2] + b^2*Cos[(c + d*x)/2])]*Sec[c + d*x]^2*(a*Cos[c + d*x] + b *Sin[c + d*x])^2)/(b^4*d*(a + b*Tan[c + d*x])^2) - (3*(2*a^2 + b^2)*Log[Co s[(c + d*x)/2] - Sin[(c + d*x)/2]]*Sec[c + d*x]^2*(a*Cos[c + d*x] + b*Sin[ c + d*x])^2)/(2*b^4*d*(a + b*Tan[c + d*x])^2) + (3*(2*a^2 + b^2)*Log[Cos[( c + d*x)/2] + Sin[(c + d*x)/2]]*Sec[c + d*x]^2*(a*Cos[c + d*x] + b*Sin[c + d*x])^2)/(2*b^4*d*(a + b*Tan[c + d*x])^2) + (Sec[c + d*x]^2*(a*Cos[c + d* x] + b*Sin[c + d*x])^2)/(4*b^2*d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^2*( a + b*Tan[c + d*x])^2) - (2*a*Sec[c + d*x]^2*Sin[(c + d*x)/2]*(a*Cos[c + d *x] + b*Sin[c + d*x])^2)/(b^3*d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])*(a + b*Tan[c + d*x])^2) - (Sec[c + d*x]^2*(a*Cos[c + d*x] + b*Sin[c + d*x])^2) /(4*b^2*d*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])^2*(a + b*Tan[c + d*x])^2) + (2*a*Sec[c + d*x]^2*Sin[(c + d*x)/2]*(a*Cos[c + d*x] + b*Sin[c + d*x])^2 )/(b^3*d*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])*(a + b*Tan[c + d*x])^2)
Time = 0.39 (sec) , antiderivative size = 161, normalized size of antiderivative = 0.91, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {3042, 3992, 492, 591, 25, 719, 222, 488, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sec (c+d x)^5}{(a+b \tan (c+d x))^2}dx\) |
\(\Big \downarrow \) 3992 |
\(\displaystyle \frac {\sec (c+d x) \int \frac {\left (\tan ^2(c+d x)+1\right )^{3/2}}{(a+b \tan (c+d x))^2}d(b \tan (c+d x))}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 492 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {3 \int \frac {b \tan (c+d x) \sqrt {\tan ^2(c+d x)+1}}{a+b \tan (c+d x)}d(b \tan (c+d x))}{b^2}-\frac {\left (\tan ^2(c+d x)+1\right )^{3/2}}{a+b \tan (c+d x)}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 591 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {3 \left (\frac {1}{2} \int -\frac {a-\left (\frac {2 a^2}{b^2}+1\right ) b \tan (c+d x)}{(a+b \tan (c+d x)) \sqrt {\tan ^2(c+d x)+1}}d(b \tan (c+d x))-\frac {1}{2} \sqrt {\tan ^2(c+d x)+1} (2 a-b \tan (c+d x))\right )}{b^2}-\frac {\left (\tan ^2(c+d x)+1\right )^{3/2}}{a+b \tan (c+d x)}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {3 \left (-\frac {1}{2} \int \frac {a-\left (\frac {2 a^2}{b^2}+1\right ) b \tan (c+d x)}{(a+b \tan (c+d x)) \sqrt {\tan ^2(c+d x)+1}}d(b \tan (c+d x))-\frac {1}{2} \sqrt {\tan ^2(c+d x)+1} (2 a-b \tan (c+d x))\right )}{b^2}-\frac {\left (\tan ^2(c+d x)+1\right )^{3/2}}{a+b \tan (c+d x)}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 719 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {3 \left (\frac {1}{2} \left (\left (\frac {2 a^2}{b^2}+1\right ) \int \frac {1}{\sqrt {\tan ^2(c+d x)+1}}d(b \tan (c+d x))-2 a \left (\frac {a^2}{b^2}+1\right ) \int \frac {1}{(a+b \tan (c+d x)) \sqrt {\tan ^2(c+d x)+1}}d(b \tan (c+d x))\right )-\frac {1}{2} \sqrt {\tan ^2(c+d x)+1} (2 a-b \tan (c+d x))\right )}{b^2}-\frac {\left (\tan ^2(c+d x)+1\right )^{3/2}}{a+b \tan (c+d x)}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 222 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {3 \left (\frac {1}{2} \left (b \left (\frac {2 a^2}{b^2}+1\right ) \text {arcsinh}(\tan (c+d x))-2 a \left (\frac {a^2}{b^2}+1\right ) \int \frac {1}{(a+b \tan (c+d x)) \sqrt {\tan ^2(c+d x)+1}}d(b \tan (c+d x))\right )-\frac {1}{2} \sqrt {\tan ^2(c+d x)+1} (2 a-b \tan (c+d x))\right )}{b^2}-\frac {\left (\tan ^2(c+d x)+1\right )^{3/2}}{a+b \tan (c+d x)}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 488 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {3 \left (\frac {1}{2} \left (2 a \left (\frac {a^2}{b^2}+1\right ) \int \frac {1}{\frac {a^2}{b^2}-b^2 \tan ^2(c+d x)+1}d\frac {1-\frac {a \tan (c+d x)}{b}}{\sqrt {\tan ^2(c+d x)+1}}+b \left (\frac {2 a^2}{b^2}+1\right ) \text {arcsinh}(\tan (c+d x))\right )-\frac {1}{2} \sqrt {\tan ^2(c+d x)+1} (2 a-b \tan (c+d x))\right )}{b^2}-\frac {\left (\tan ^2(c+d x)+1\right )^{3/2}}{a+b \tan (c+d x)}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {\sec (c+d x) \left (\frac {3 \left (\frac {1}{2} \left (b \left (\frac {2 a^2}{b^2}+1\right ) \text {arcsinh}(\tan (c+d x))+\frac {2 a b \left (\frac {a^2}{b^2}+1\right ) \text {arctanh}\left (\frac {b^2 \tan (c+d x)}{\sqrt {a^2+b^2}}\right )}{\sqrt {a^2+b^2}}\right )-\frac {1}{2} \sqrt {\tan ^2(c+d x)+1} (2 a-b \tan (c+d x))\right )}{b^2}-\frac {\left (\tan ^2(c+d x)+1\right )^{3/2}}{a+b \tan (c+d x)}\right )}{b d \sqrt {\sec ^2(c+d x)}}\) |
(Sec[c + d*x]*(-((1 + Tan[c + d*x]^2)^(3/2)/(a + b*Tan[c + d*x])) + (3*((( 1 + (2*a^2)/b^2)*b*ArcSinh[Tan[c + d*x]] + (2*a*(1 + a^2/b^2)*b*ArcTanh[(b ^2*Tan[c + d*x])/Sqrt[a^2 + b^2]])/Sqrt[a^2 + b^2])/2 - ((2*a - b*Tan[c + d*x])*Sqrt[1 + Tan[c + d*x]^2])/2))/b^2))/(b*d*Sqrt[Sec[c + d*x]^2])
3.6.61.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Simp[ArcSinh[Rt[b, 2]*(x/Sqrt [a])]/Rt[b, 2], x] /; FreeQ[{a, b}, x] && GtQ[a, 0] && PosQ[b]
Int[1/(((c_) + (d_.)*(x_))*Sqrt[(a_) + (b_.)*(x_)^2]), x_Symbol] :> -Subst[ Int[1/(b*c^2 + a*d^2 - x^2), x], x, (a*d - b*c*x)/Sqrt[a + b*x^2]] /; FreeQ [{a, b, c, d}, x]
Int[((c_) + (d_.)*(x_))^(n_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[ (c + d*x)^(n + 1)*((a + b*x^2)^p/(d*(n + 1))), x] - Simp[2*b*(p/(d*(n + 1)) ) Int[x*(c + d*x)^(n + 1)*(a + b*x^2)^(p - 1), x], x] /; FreeQ[{a, b, c, d, n}, x] && GtQ[p, 0] && (IntegerQ[p] || LtQ[n, -1]) && NeQ[n, -1] && !IL tQ[n + 2*p + 1, 0] && IntQuadraticQ[a, 0, b, c, d, n, p, x]
Int[(x_)*((c_) + (d_.)*(x_))^(n_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(-(c + d*x)^(n + 1))*(a + b*x^2)^p*((c*(2*p + 1) - d*(n + 2*p + 1)*x)/ (d^2*(n + 2*p + 1)*(n + 2*p + 2))), x] + Simp[2*(p/(d^2*(n + 2*p + 1)*(n + 2*p + 2))) Int[(c + d*x)^n*(a + b*x^2)^(p - 1)*Simp[a*c*d*n + (b*c^2*(2*p + 1) + a*d^2*(n + 2*p + 1))*x, x], x], x] /; FreeQ[{a, b, c, d, n}, x] && GtQ[p, 0] && LeQ[-1, n, 0] && !ILtQ[n + 2*p, 0]
Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p _.), x_Symbol] :> Simp[g/e Int[(d + e*x)^(m + 1)*(a + c*x^2)^p, x], x] + Simp[(e*f - d*g)/e Int[(d + e*x)^m*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g, m, p}, x] && !IGtQ[m, 0]
Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n _), x_Symbol] :> Simp[Sec[e + f*x]/(b*f*Sqrt[Sec[e + f*x]^2]) Subst[Int[( a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b , e, f, n}, x] && NeQ[a^2 + b^2, 0] && IntegerQ[(m - 1)/2]
Time = 32.08 (sec) , antiderivative size = 259, normalized size of antiderivative = 1.47
method | result | size |
derivativedivides | \(\frac {\frac {1}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {-4 a -b}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (-6 a^{2}-3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 b^{4}}-\frac {1}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {4 a -b}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\left (6 a^{2}+3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 b^{4}}+\frac {\frac {2 \left (\frac {\left (a^{2}+b^{2}\right ) b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a}+b \left (a^{2}+b^{2}\right )\right )}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a}-6 a \sqrt {a^{2}+b^{2}}\, \operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b^{4}}}{d}\) | \(259\) |
default | \(\frac {\frac {1}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {-4 a -b}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (-6 a^{2}-3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 b^{4}}-\frac {1}{2 b^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )^{2}}-\frac {4 a -b}{2 b^{3} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}+\frac {\left (6 a^{2}+3 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 b^{4}}+\frac {\frac {2 \left (\frac {\left (a^{2}+b^{2}\right ) b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a}+b \left (a^{2}+b^{2}\right )\right )}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-a}-6 a \sqrt {a^{2}+b^{2}}\, \operatorname {arctanh}\left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b^{4}}}{d}\) | \(259\) |
risch | \(-\frac {-3 i a b \,{\mathrm e}^{5 i \left (d x +c \right )}+6 a^{2} {\mathrm e}^{5 i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{5 i \left (d x +c \right )}+12 a^{2} {\mathrm e}^{3 i \left (d x +c \right )}+2 b^{2} {\mathrm e}^{3 i \left (d x +c \right )}+3 i a b \,{\mathrm e}^{i \left (d x +c \right )}+6 a^{2} {\mathrm e}^{i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{i \left (d x +c \right )}}{\left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2} \left (-i b \,{\mathrm e}^{2 i \left (d x +c \right )}+a \,{\mathrm e}^{2 i \left (d x +c \right )}+i b +a \right ) d \,b^{3}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2}}{d \,b^{4}}+\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d \,b^{2}}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{d \,b^{4}}-\frac {3 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d \,b^{2}}+\frac {3 \sqrt {a^{2}+b^{2}}\, a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a -b}{\sqrt {a^{2}+b^{2}}}\right )}{d \,b^{4}}-\frac {3 \sqrt {a^{2}+b^{2}}\, a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a -b}{\sqrt {a^{2}+b^{2}}}\right )}{d \,b^{4}}\) | \(353\) |
1/d*(1/2/b^2/(tan(1/2*d*x+1/2*c)-1)^2-1/2*(-4*a-b)/b^3/(tan(1/2*d*x+1/2*c) -1)+1/2/b^4*(-6*a^2-3*b^2)*ln(tan(1/2*d*x+1/2*c)-1)-1/2/b^2/(tan(1/2*d*x+1 /2*c)+1)^2-1/2*(4*a-b)/b^3/(tan(1/2*d*x+1/2*c)+1)+1/2/b^4*(6*a^2+3*b^2)*ln (tan(1/2*d*x+1/2*c)+1)+2/b^4*(((a^2+b^2)*b^2/a*tan(1/2*d*x+1/2*c)+b*(a^2+b ^2))/(tan(1/2*d*x+1/2*c)^2*a-2*b*tan(1/2*d*x+1/2*c)-a)-3*a*(a^2+b^2)^(1/2) *arctanh(1/2*(2*a*tan(1/2*d*x+1/2*c)-2*b)/(a^2+b^2)^(1/2))))
Leaf count of result is larger than twice the leaf count of optimal. 355 vs. \(2 (163) = 326\).
Time = 0.32 (sec) , antiderivative size = 355, normalized size of antiderivative = 2.02 \[ \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {6 \, a b^{2} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, b^{3} + 6 \, {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} - 6 \, {\left (a^{2} \cos \left (d x + c\right )^{3} + a b \cos \left (d x + c\right )^{2} \sin \left (d x + c\right )\right )} \sqrt {a^{2} + b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right ) - 3 \, {\left ({\left (2 \, a^{3} + a b^{2}\right )} \cos \left (d x + c\right )^{3} + {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} \sin \left (d x + c\right )\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, {\left ({\left (2 \, a^{3} + a b^{2}\right )} \cos \left (d x + c\right )^{3} + {\left (2 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )^{2} \sin \left (d x + c\right )\right )} \log \left (-\sin \left (d x + c\right ) + 1\right )}{4 \, {\left (a b^{4} d \cos \left (d x + c\right )^{3} + b^{5} d \cos \left (d x + c\right )^{2} \sin \left (d x + c\right )\right )}} \]
-1/4*(6*a*b^2*cos(d*x + c)*sin(d*x + c) - 2*b^3 + 6*(2*a^2*b + b^3)*cos(d* x + c)^2 - 6*(a^2*cos(d*x + c)^3 + a*b*cos(d*x + c)^2*sin(d*x + c))*sqrt(a ^2 + b^2)*log((2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^ 2 - 2*a^2 - b^2 - 2*sqrt(a^2 + b^2)*(b*cos(d*x + c) - a*sin(d*x + c)))/(2* a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2)) - 3*((2 *a^3 + a*b^2)*cos(d*x + c)^3 + (2*a^2*b + b^3)*cos(d*x + c)^2*sin(d*x + c) )*log(sin(d*x + c) + 1) + 3*((2*a^3 + a*b^2)*cos(d*x + c)^3 + (2*a^2*b + b ^3)*cos(d*x + c)^2*sin(d*x + c))*log(-sin(d*x + c) + 1))/(a*b^4*d*cos(d*x + c)^3 + b^5*d*cos(d*x + c)^2*sin(d*x + c))
\[ \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\int \frac {\sec ^{5}{\left (c + d x \right )}}{\left (a + b \tan {\left (c + d x \right )}\right )^{2}}\, dx \]
Leaf count of result is larger than twice the leaf count of optimal. 471 vs. \(2 (163) = 326\).
Time = 0.33 (sec) , antiderivative size = 471, normalized size of antiderivative = 2.68 \[ \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx=-\frac {\frac {2 \, {\left (6 \, a^{3} + 2 \, a b^{2} + \frac {6 \, a^{3} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {{\left (9 \, a^{2} b + 2 \, b^{3}\right )} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {6 \, {\left (2 \, a^{3} + a b^{2}\right )} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {4 \, {\left (3 \, a^{2} b + b^{3}\right )} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {{\left (3 \, a^{2} b + 2 \, b^{3}\right )} \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}}\right )}}{a^{2} b^{3} + \frac {2 \, a b^{4} \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {3 \, a^{2} b^{3} \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {4 \, a b^{4} \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {3 \, a^{2} b^{3} \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {2 \, a b^{4} \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {a^{2} b^{3} \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}}} - \frac {6 \, \sqrt {a^{2} + b^{2}} a \log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{b^{4}} - \frac {3 \, {\left (2 \, a^{2} + b^{2}\right )} \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{b^{4}} + \frac {3 \, {\left (2 \, a^{2} + b^{2}\right )} \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{b^{4}}}{2 \, d} \]
-1/2*(2*(6*a^3 + 2*a*b^2 + 6*a^3*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 + (9* a^2*b + 2*b^3)*sin(d*x + c)/(cos(d*x + c) + 1) - 6*(2*a^3 + a*b^2)*sin(d*x + c)^2/(cos(d*x + c) + 1)^2 - 4*(3*a^2*b + b^3)*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 + (3*a^2*b + 2*b^3)*sin(d*x + c)^5/(cos(d*x + c) + 1)^5)/(a^2*b ^3 + 2*a*b^4*sin(d*x + c)/(cos(d*x + c) + 1) - 3*a^2*b^3*sin(d*x + c)^2/(c os(d*x + c) + 1)^2 - 4*a*b^4*sin(d*x + c)^3/(cos(d*x + c) + 1)^3 + 3*a^2*b ^3*sin(d*x + c)^4/(cos(d*x + c) + 1)^4 + 2*a*b^4*sin(d*x + c)^5/(cos(d*x + c) + 1)^5 - a^2*b^3*sin(d*x + c)^6/(cos(d*x + c) + 1)^6) - 6*sqrt(a^2 + b ^2)*a*log((b - a*sin(d*x + c)/(cos(d*x + c) + 1) + sqrt(a^2 + b^2))/(b - a *sin(d*x + c)/(cos(d*x + c) + 1) - sqrt(a^2 + b^2)))/b^4 - 3*(2*a^2 + b^2) *log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/b^4 + 3*(2*a^2 + b^2)*log(sin(d* x + c)/(cos(d*x + c) + 1) - 1)/b^4)/d
Time = 0.50 (sec) , antiderivative size = 280, normalized size of antiderivative = 1.59 \[ \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {\frac {3 \, {\left (2 \, a^{2} + b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{b^{4}} - \frac {3 \, {\left (2 \, a^{2} + b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{b^{4}} + \frac {6 \, {\left (a^{3} + a b^{2}\right )} \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{\sqrt {a^{2} + b^{2}} b^{4}} + \frac {2 \, {\left (b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 4 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, a\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2} b^{3}} + \frac {4 \, {\left (a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{3} + a b^{2}\right )}}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a\right )} a b^{3}}}{2 \, d} \]
1/2*(3*(2*a^2 + b^2)*log(abs(tan(1/2*d*x + 1/2*c) + 1))/b^4 - 3*(2*a^2 + b ^2)*log(abs(tan(1/2*d*x + 1/2*c) - 1))/b^4 + 6*(a^3 + a*b^2)*log(abs(2*a*t an(1/2*d*x + 1/2*c) - 2*b - 2*sqrt(a^2 + b^2))/abs(2*a*tan(1/2*d*x + 1/2*c ) - 2*b + 2*sqrt(a^2 + b^2)))/(sqrt(a^2 + b^2)*b^4) + 2*(b*tan(1/2*d*x + 1 /2*c)^3 + 4*a*tan(1/2*d*x + 1/2*c)^2 + b*tan(1/2*d*x + 1/2*c) - 4*a)/((tan (1/2*d*x + 1/2*c)^2 - 1)^2*b^3) + 4*(a^2*b*tan(1/2*d*x + 1/2*c) + b^3*tan( 1/2*d*x + 1/2*c) + a^3 + a*b^2)/((a*tan(1/2*d*x + 1/2*c)^2 - 2*b*tan(1/2*d *x + 1/2*c) - a)*a*b^3))/d
Time = 5.94 (sec) , antiderivative size = 585, normalized size of antiderivative = 3.32 \[ \int \frac {\sec ^5(c+d x)}{(a+b \tan (c+d x))^2} \, dx=\frac {\mathrm {atanh}\left (\frac {648\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{216\,a\,b^2+648\,a^3+\frac {432\,a^5}{b^2}}+\frac {432\,a^5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{432\,a^5+648\,a^3\,b^2+216\,a\,b^4}+\frac {216\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{216\,a+\frac {648\,a^3}{b^2}+\frac {432\,a^5}{b^4}}\right )\,\left (6\,a^2+3\,b^2\right )}{b^4\,d}-\frac {\frac {2\,\left (3\,a^2+b^2\right )}{b^3}+\frac {6\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{b^3}-\frac {6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (2\,a^2+b^2\right )}{b^3}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (9\,a^2+2\,b^2\right )}{a\,b^2}-\frac {4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (3\,a^2+b^2\right )}{a\,b^2}+\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (3\,a^2+2\,b^2\right )}{a\,b^2}}{d\,\left (-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-3\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )}-\frac {6\,a\,\mathrm {atanh}\left (\frac {432\,a^3\,\sqrt {a^2+b^2}}{432\,a^3\,b+\frac {432\,a^5}{b}+864\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+864\,a^2\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}+\frac {864\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2+b^2}}{432\,a^3+\frac {432\,a^5}{b^2}+864\,a^2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {864\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b}}+\frac {432\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2+b^2}}{432\,a^5+864\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^4\,b+432\,a^3\,b^2+864\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2\,b^3}\right )\,\sqrt {a^2+b^2}}{b^4\,d} \]
(atanh((648*a^3*tan(c/2 + (d*x)/2))/(216*a*b^2 + 648*a^3 + (432*a^5)/b^2) + (432*a^5*tan(c/2 + (d*x)/2))/(216*a*b^4 + 432*a^5 + 648*a^3*b^2) + (216* a*tan(c/2 + (d*x)/2))/(216*a + (648*a^3)/b^2 + (432*a^5)/b^4))*(6*a^2 + 3* b^2))/(b^4*d) - ((2*(3*a^2 + b^2))/b^3 + (6*a^2*tan(c/2 + (d*x)/2)^4)/b^3 - (6*tan(c/2 + (d*x)/2)^2*(2*a^2 + b^2))/b^3 + (tan(c/2 + (d*x)/2)*(9*a^2 + 2*b^2))/(a*b^2) - (4*tan(c/2 + (d*x)/2)^3*(3*a^2 + b^2))/(a*b^2) + (tan( c/2 + (d*x)/2)^5*(3*a^2 + 2*b^2))/(a*b^2))/(d*(a + 2*b*tan(c/2 + (d*x)/2) - 3*a*tan(c/2 + (d*x)/2)^2 + 3*a*tan(c/2 + (d*x)/2)^4 - a*tan(c/2 + (d*x)/ 2)^6 - 4*b*tan(c/2 + (d*x)/2)^3 + 2*b*tan(c/2 + (d*x)/2)^5)) - (6*a*atanh( (432*a^3*(a^2 + b^2)^(1/2))/(432*a^3*b + (432*a^5)/b + 864*a^4*tan(c/2 + ( d*x)/2) + 864*a^2*b^2*tan(c/2 + (d*x)/2)) + (864*a^2*tan(c/2 + (d*x)/2)*(a ^2 + b^2)^(1/2))/(432*a^3 + (432*a^5)/b^2 + 864*a^2*b*tan(c/2 + (d*x)/2) + (864*a^4*tan(c/2 + (d*x)/2))/b) + (432*a^4*tan(c/2 + (d*x)/2)*(a^2 + b^2) ^(1/2))/(432*a^5 + 432*a^3*b^2 + 864*a^4*b*tan(c/2 + (d*x)/2) + 864*a^2*b^ 3*tan(c/2 + (d*x)/2)))*(a^2 + b^2)^(1/2))/(b^4*d)